// collate::hash example
#include <iostream>
#include <locale>
using namespace std;

int main ()
{
  string myberry = "strawberry";
  string yourberry;

  locale loc;                 // the "C" locale
  char hola[]="hola";
  char hi[]="hi";
  yourberry=hola;
  yourberry=hi;
  cout<<yourberry<<endl;
  const collate<char>& coll = use_facet<collate<char> >(loc);

  long myhash = coll.hash(myberry.data(),myberry.data()+myberry.length());

  while(true){
  cout << "Please, enter your favorite berry:";
  getline (cin,yourberry);

  long yourhash = coll.hash(yourberry.data(),yourberry.data()+yourberry.length());
    cout << "my hash: " << yourhash << endl;
  }
  return 0;
}
